home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / AMOSList / AMOSLIST / text0136.txt < prev    next >
Encoding:
Text File  |  1998-04-01  |  1.3 KB  |  47 lines

  1. To the one known as Garfield,
  2.  
  3. > > As a substitute for select...case I don't think either is good. They're
  4. > > both messy. Try this instead:
  5. > > If AGE<10
  6. > >    Print "You are less than 10 years old."
  7. > > else if AGE=21
  8. > >    Print "Hey!! Now you can drink alcohol in the U.S.!!"
  9. > > else
  10. > >    Print "WOW, you're OVER 21!!"
  11. > > endif
  12. > > Smallest, and tidiest in my humble opinion.
  13. > > Is my approach good enough in the meantime?
  14. >    Well, problem is this won't work. First, you need to match every
  15.  
  16. <Cough>  Yes it will.
  17.  
  18. >    If with an End If and second, the logic is not the same.  To write
  19. >    it in the above style, so it will work in AMOS while retaining the
  20. >    original logic, you'd need to do something like this:
  21. > If AGE<10
  22. >    Print "You are less than 10 years old."
  23. > Else If AGE=21
  24. >       Print"Hey!! Now you can drink alcohol in the U.S.!!"
  25. >    Else If AGE>21
  26. >          Print "WOW, you'r OVER 21!!"
  27. >       End If
  28. >    End If
  29. > End If
  30.  
  31. What ARE you doing ?
  32.  
  33. Amos explicitly implments "else if".
  34.  
  35. cyagain.
  36.  
  37.  
  38.  
  39.  _   _   _        _     _   _     |  
  40. |_> |_| |_| |\ | |_ |  | | /   |  |  "As if !"
  41. |_> | \ | | | \| |_ |_ |_| \_  .  |  
  42.                                   |  
  43.                     --------------+---------------
  44.                      http://www.mirex.demon.co.uk
  45.                       Member: IAPA & Team *AMOS*
  46.  
  47.